"duplicate key value violates unique constraint" ERROR

"duplicate key value violates unique constraint" ERROR

am 05.05.2010 12:22:36 von Renato Oliveira

--_000_7965A9DCF12CC14984420BCC37B1608F25AC1C6612Elzargrantc ou_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Dear all,

I am sorry to have another post.
I have been following a problem which has been growing fast on our system.

At the beginning I thought it was related to load on PG server, then I thou=
ght it was load on the switch/network, now I don't know.

We seem to get loads of Exception errors and when I look at the Postgres Lo=
g there are loads of "duplicate key value violates unique constraint"

I have researched on the Internet and some posts say: Reindex, some say bug=
in JIRA.
Some say: Your primary key index isn't in sync.

Have you guys suffered from this problem before, or have seen it anywhere?

From 30th of April to today I got 1400 errors.
What do you guys think might cause this behavior?
I also think it is causing the system to slow down a bit, do you think that=
might be possible?

Very much appreciate any help, insight, opinion or anything you could think=
..

Thank you very much


Best regards

Renato


Renato Oliveira
Systems Administrator
e-mail: renato.oliveira@grant.co.uk

Tel: +44 (0)1763 260811
Fax: +44 (0)1763 262410
www.grant.co.uk

Grant Instruments (Cambridge) Ltd

Company registered in England, registration number 658133

Registered office address:
29 Station Road,
Shepreth,
CAMBS SG8 6GB
UK





P Please consider the environment before printing this email
CONFIDENTIALITY: The information in this e-mail and any attachments is conf=
idential. It is intended only for the named recipients(s). If you are not t=
he named recipient please notify the sender immediately and do not disclose=
the contents to another person or take copies.

VIRUSES: The contents of this e-mail or attachment(s) may contain viruses w=
hich could damage your own computer system. Whilst Grant Instruments (Cambr=
idge) Ltd has taken every reasonable precaution to minimise this risk, we c=
annot accept liability for any damage which you sustain as a result of soft=
ware viruses. You should therefore carry out your own virus checks before o=
pening the attachment(s).

OpenXML: For information about the OpenXML file format in use within Grant =
Instruments please visit our website ..html>

--_000_7965A9DCF12CC14984420BCC37B1608F25AC1C6612Elzargrantc ou_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:access" xmlns:b=3D"urn:schemas-microsoft-com:office:publis=
her" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" xml=
ns:D=3D"DAV:" xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/di r=
ectory/" xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" xmlns:dsp=3D"http:=
//schemas.microsoft.com/sharepoint/dsp" xmlns:dssi=3D"http://schemas.micros=
oft.com/office/2006/digsig" xmlns:dsss=3D"http://schemas.microsoft.com/offi=
ce/2006/digsig-setup" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882=
" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" xmlns:ex12m=3D"http://sche=
mas.microsoft.com/exchange/services/2006/messages" xmlns:ex12t=3D"http://sc=
hemas.microsoft.com/exchange/services/2006/types" xmlns:html=3D"http://www.=
w3.org/TR/REC-html40" xmlns:m=3D"http://schemas.microsoft.com/office/2004/1=
2/omml" xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/200 6/digit=
al-signature" xmlns:mrels=3D"http://schemas.openxmlformats.org/package/200 6=
/relationships" xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/me=
etings/" xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compa tibili=
ty/2006" xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:oa=3D"ur=
n:schemas-microsoft-com:office:activation" xmlns:odc=3D"urn:schemas-microso=
ft-com:office:odc" xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soa=
p/ois/" xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" xmlns:ppda=
=3D"http://www.passport.com/NameSpace.xsd" xmlns:pptsl=3D"http://schemas.mi=
crosoft.com/sharepoint/soap/SlideLibrary/" xmlns:q=3D"http://schemas.xmlsoa=
p.org/soap/envelope/" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" xml=
ns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:rtc=3D"http://microsoft.co=
m/officenet/conferencing" xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14=
882" xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" xmlns:sps=3D"htt=
p://schemas.microsoft.com/sharepoint/soap/" xmlns:spsl=3D"http://microsoft.=
com/webservices/SharePointPortalServer/PublishedLinksService " xmlns:spwp=3D=
"http://microsoft.com/sharepoint/webpartpages" xmlns:ss=3D"urn:schemas-micr=
osoft-com:office:spreadsheet" xmlns:st=3D"" xmlns:sub=3D"http://schemas=
..microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:udc=3D"http://schemas.=
microsoft.com/data/udc" xmlns:udcp2p=3D"http://schemas.microsoft.com/data/u=
dc/parttopart" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" xm=
lns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" xmlns:v=3D"urn:=
schemas-microsoft-com:vml" xmlns:w=3D"urn:schemas-microsoft-com:office:word=
" xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/wor kflow/" xmlns=
:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:x2=3D"http://schemas.mi=
crosoft.com/office/excel/2003/xml" xmlns:xsd=3D"http://www.w3.org/2001/XMLS=
chema" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xmlns:Z=3D"u=
rn:schemas-microsoft-com:"> scii" http-equiv=3D"Content-Type">
>












Dear all,



 



I am sorry to have another post.



I have been following a problem which has been growing=
fast
on our system.



 



At the beginning I thought it was related to load on P=
G
server, then I thought it was load on the switch/network, now I don’t
know.



 



We seem to get loads of Exception errors and when I lo=
ok at
the Postgres Log there are loads of “ ze:9.0pt;
font-family:"Arial","sans-serif";color:#333333'>duplicate key value violate=
s
unique constraint”



Arial","sans-serif";
color:#333333'> 



Arial","sans-serif";
color:#333333'>I have researched on the Internet and some posts say: Reinde=
x,
some say bug in JIRA.



Arial","sans-serif";
color:#333333'>Some say:
Your primary key index isn'=
t in
sync.



 



Have you guys suffered from this probl=
em
before, or have seen it anywhere?



 



From 30th of April to today=
I got
1400 errors.



What do you guys think might cause thi=
s behavior?



I also think it is causing the system =
to slow
down a bit, do you think that might be possible?



 



Very much appreciate any help, insight=
,
opinion or anything you could think.



 



Thank you very much<=
/p>

 



Arial","sans-serif";
color:#333333'> 



Arial","sans-serif";
color:#333333'>Best regards



Arial","sans-serif";
color:#333333'> 



Arial","sans-serif";
color:#333333'>Renato



 






 

Renato=
Oliveira
Systems Administrator
e-mail: renato.oliveira@grant.co.uk FONT>
>

> 

Tel: +=
44 (0)1763 260811
Fax: +44 (0)1763 262410
..co.uk/">www.grant.co.uk

> 

Grant =
Instruments (Cambridge) Ltd
 
Company registered in England, re=
gistration number 658133
 
Registered office address:
29 Stat=
ion Road,
Shepreth,
CAMBS SG8 6GB
UK

> ONT> 

>

> 

>

 

>

 


; COLOR: green; FONT-FAMILY: Webdings"> 


; COLOR: green; FONT-FAMILY: Webdings">P =3D"EN-US" STYLE=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','=
sans-serif'">
OLOR: green; FONT-FAMILY: 'Arial','sans-serif'">Please consider the environ=
ment before printing this email


CONFIDENTIALITY: The =
information in this e-mail and any attachments is confidential. It is inten=
ded only for the named recipients(s). If you are not the named recipient pl=
ease notify the sender immediately and do not disclose the contents to anot=
her person or take copies.

 


VIRUSES: The contents=
of this e-mail or attachment(s) may contain viruses which could damage you=
r own computer system. Whilst Grant Instruments (Cambridge) Ltd has taken e=
very reasonable precaution to minimise this risk, we cannot accept liabilit=
y for any damage which you sustain as a result of software viruses. You sho=
uld therefore carry out your own virus checks before opening the attachment=
(s).

 


OpenXML: For informat=
ion about the OpenXML file format in use within Grant Instruments please vi=
sit our =


--_000_7965A9DCF12CC14984420BCC37B1608F25AC1C6612Elzargrantc ou_--

Re: "duplicate key value violates unique constraint" ERROR

am 05.05.2010 12:36:29 von Ian Lea

The most likely cause is surely application error: your application is
attempting to insert rows into a table and those new rows have the
primary key set to a value that is already present for that table.
Could be the app isn't checking properly before doing an insert (or
update), could be you are trying to load data twice, could be whatever
is generating the data in the first place is generating duplicates,
etc.

Seems unlikely that the exception itself would cause your system to
slow down but whatever is causing the exception (trying to load
everything multiple times?) might be.


--
Ian.



On Wed, May 5, 2010 at 11:22 AM, Renato Oliveira
wrote:
> Dear all,
>
>
>
> I am sorry to have another post.
>
> I have been following a problem which has been growing fast on our system.
>
>
>
> At the beginning I thought it was related to load on PG server, then I
> thought it was load on the switch/network, now I don=92t know.
>
>
>
> We seem to get loads of Exception errors and when I look at the Postgres =
Log
> there are loads of =93duplicate key value violates unique constraint=94
>
>
>
> I have researched on the Internet and some posts say: Reindex, some say b=
ug
> in JIRA.
>
> Some say: Your primary key index isn't in sync.
>
>
>
> Have you guys suffered from this problem before, or have seen it anywhere?
>
>
>
> From 30th of April to today I got 1400 errors.
>
> What do you guys think might cause this behavior?
>
> I also think it is causing the system to slow down a bit, do you think th=
at
> might be possible?
>
>
>
> Very much appreciate any help, insight, opinion or anything you could thi=
nk.
>
>
>
> Thank you very much
>
>
>
>
>
> Best regards
>
>
>
> Renato
>
>
>
>
> Renato Oliveira
> Systems Administrator
> e-mail: renato.oliveira@grant.co.uk
>
> Tel: +44 (0)1763 260811
> Fax: +44 (0)1763 262410
> www.grant.co.uk
>
> Grant Instruments (Cambridge) Ltd
>
> Company registered in England, registration number 658133
>
> Registered office address:
> 29 Station Road,
> Shepreth,
> CAMBS SG8 6GB
> UK
>
>
>
>
>
>
>
> P Please consider the environment before printing this email
>
> CONFIDENTIALITY: The information in this e-mail and any attachments is
> confidential. It is intended only for the named recipients(s). If you are
> not the named recipient please notify the sender immediately and do not
> disclose the contents to another person or take copies.
>
> VIRUSES: The contents of this e-mail or attachment(s) may contain viruses
> which could damage your own computer system. Whilst Grant Instruments
> (Cambridge) Ltd has taken every reasonable precaution to minimise this ri=
sk,
> we cannot accept liability for any damage which you sustain as a result of
> software viruses. You should therefore carry out your own virus checks
> before opening the attachment(s).
>
> OpenXML: For information about the OpenXML file format in use within Grant
> Instruments please visit our website

--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: "duplicate key value violates unique constraint" ERROR

am 05.05.2010 13:02:01 von Renato Oliveira

Ian,

Thank you very much for your reply.

Really appreciated it.
Thank you

Renato



Renato Oliveira
Systems Administrator
e-mail: renato.oliveira@grant.co.uk

Tel: +44 (0)1763 260811
Fax: +44 (0)1763 262410
http://www.grant.co.uk/

Grant Instruments (Cambridge) Ltd

Company registered in England, registration number 658133

Registered office address:
29 Station Road,
Shepreth,
CAMBS SG8 6GB
UK

-----Original Message-----


From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: 05 May 2010 11:36
To: Renato Oliveira
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] "duplicate key value violates unique constraint" ERROR

The most likely cause is surely application error: your application is
attempting to insert rows into a table and those new rows have the
primary key set to a value that is already present for that table.
Could be the app isn't checking properly before doing an insert (or
update), could be you are trying to load data twice, could be whatever
is generating the data in the first place is generating duplicates,
etc.

Seems unlikely that the exception itself would cause your system to
slow down but whatever is causing the exception (trying to load
everything multiple times?) might be.


--
Ian.



On Wed, May 5, 2010 at 11:22 AM, Renato Oliveira
wrote:
> Dear all,
>
>
>
> I am sorry to have another post.
>
> I have been following a problem which has been growing fast on our system.
>
>
>
> At the beginning I thought it was related to load on PG server, then I
> thought it was load on the switch/network, now I don't know.
>
>
>
> We seem to get loads of Exception errors and when I look at the Postgres =
Log
> there are loads of "duplicate key value violates unique constraint"
>
>
>
> I have researched on the Internet and some posts say: Reindex, some say b=
ug
> in JIRA.
>
> Some say: Your primary key index isn't in sync.
>
>
>
> Have you guys suffered from this problem before, or have seen it anywhere?
>
>
>
> From 30th of April to today I got 1400 errors.
>
> What do you guys think might cause this behavior?
>
> I also think it is causing the system to slow down a bit, do you think th=
at
> might be possible?
>
>
>
> Very much appreciate any help, insight, opinion or anything you could thi=
nk.
>
>
>
> Thank you very much
>
>
>
>
>
> Best regards
>
>
>
> Renato
>
>
>
>
> Renato Oliveira
> Systems Administrator
> e-mail: renato.oliveira@grant.co.uk
>
> Tel: +44 (0)1763 260811
> Fax: +44 (0)1763 262410
> www.grant.co.uk
>
> Grant Instruments (Cambridge) Ltd
>
> Company registered in England, registration number 658133
>
> Registered office address:
> 29 Station Road,
> Shepreth,
> CAMBS SG8 6GB
> UK
>
>
>
>
>
>
>
> P Please consider the environment before printing this email
>
> CONFIDENTIALITY: The information in this e-mail and any attachments is
> confidential. It is intended only for the named recipients(s). If you are
> not the named recipient please notify the sender immediately and do not
> disclose the contents to another person or take copies.
>
> VIRUSES: The contents of this e-mail or attachment(s) may contain viruses
> which could damage your own computer system. Whilst Grant Instruments
> (Cambridge) Ltd has taken every reasonable precaution to minimise this ri=
sk,
> we cannot accept liability for any damage which you sustain as a result of
> software viruses. You should therefore carry out your own virus checks
> before opening the attachment(s).
>
> OpenXML: For information about the OpenXML file format in use within Grant
> Instruments please visit our website



-----Original Message-----


P Please consider the environment before printing this email
CONFIDENTIALITY: The information in this e-mail and any attachments is conf=
idential. It is intended only for the named recipients(s). If you are not t=
he named recipient please notify the sender immediately and do not disclose=
the contents to another person or take copies.

VIRUSES: The contents of this e-mail or attachment(s) may contain viruses w=
hich could damage your own computer system. Whilst Grant Instruments (Cambr=
idge) Ltd has taken every reasonable precaution to minimise this risk, we c=
annot accept liability for any damage which you sustain as a result of soft=
ware viruses. You should therefore carry out your own virus checks before o=
pening the attachment(s).

OpenXML: For information about the OpenXML file format in use within Grant =
Instruments please visit our http://www.grant.co.uk/Support/openxml.html


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin